/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.bumblebee.entities;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author numessi
 */
@Entity
@Table(name = "Transaction")
@NamedQueries({
    @NamedQuery(name = "Transaction.findAll", query = "SELECT t FROM Transaction t"),
    @NamedQuery(name = "Transaction.findByTransactionId", query = "SELECT t FROM Transaction t WHERE t.transactionId = :transactionId"),
    @NamedQuery(name = "Transaction.findByTransactionQuantity", query = "SELECT t FROM Transaction t WHERE t.transactionQuantity = :transactionQuantity"),
    @NamedQuery(name = "Transaction.findByTransactionTotalPrice", query = "SELECT t FROM Transaction t WHERE t.transactionTotalPrice = :transactionTotalPrice"),
    @NamedQuery(name = "Transaction.findByItemId", query = "SELECT t FROM Transaction t WHERE t.itemId = :itemId"),
    @NamedQuery(name = "Transaction.findByCustomerId", query = "SELECT t FROM Transaction t WHERE t.customerId = :customerId"),
    @NamedQuery(name = "Transaction.findByUserId", query = "SELECT t FROM Transaction t WHERE t.userId = :userId"),
    @NamedQuery(name = "Transaction.findByTransactionDate", query = "SELECT t FROM Transaction t WHERE t.transactionDate = :transactionDate"),
    @NamedQuery(name = "Transaction.findByTransactionLocation", query = "SELECT t FROM Transaction t WHERE t.transactionLocation = :transactionLocation")})
public class Transaction implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "transaction_id")
    private Integer transactionId;
    @Column(name = "transaction_quantity")
    private Integer transactionQuantity;
    @Column(name = "transaction_total_price")
    private Double transactionTotalPrice;
    @Column(name = "item_id")
    private Integer itemId;
    @Column(name = "customer_id")
    private String customerId;
    @Column(name = "user_id")
    private String userId;
    @Column(name = "transaction_date")
    @Temporal(TemporalType.DATE)
    private Date transactionDate;
    @Basic(optional = false)
    @Column(name = "transaction_location")
    private String transactionLocation;

    public Transaction() {
    }

    public Transaction(Integer transactionId) {
        this.transactionId = transactionId;
    }

    public Transaction(Integer transactionId, String transactionLocation) {
        this.transactionId = transactionId;
        this.transactionLocation = transactionLocation;
    }

    public Integer getTransactionId() {
        return transactionId;
    }

    public void setTransactionId(Integer transactionId) {
        this.transactionId = transactionId;
    }

    public Integer getTransactionQuantity() {
        return transactionQuantity;
    }

    public void setTransactionQuantity(Integer transactionQuantity) {
        this.transactionQuantity = transactionQuantity;
    }

    public Double getTransactionTotalPrice() {
        return transactionTotalPrice;
    }

    public void setTransactionTotalPrice(Double transactionTotalPrice) {
        this.transactionTotalPrice = transactionTotalPrice;
    }

    public Integer getItemId() {
        return itemId;
    }

    public void setItemId(Integer itemId) {
        this.itemId = itemId;
    }

    public String getCustomerId() {
        return customerId;
    }

    public void setCustomerId(String customerId) {
        this.customerId = customerId;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public Date getTransactionDate() {
        return transactionDate;
    }

    public void setTransactionDate(Date transactionDate) {
        this.transactionDate = transactionDate;
    }

    public String getTransactionLocation() {
        return transactionLocation;
    }

    public void setTransactionLocation(String transactionLocation) {
        this.transactionLocation = transactionLocation;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (transactionId != null ? transactionId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Transaction)) {
            return false;
        }
        Transaction other = (Transaction) object;
        if ((this.transactionId == null && other.transactionId != null) || (this.transactionId != null && !this.transactionId.equals(other.transactionId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.bumblebee.entities.Transaction[transactionId=" + transactionId + "]";
    }

}
